import React, {Component} from 'react';
import logo from './logo.svg';
import './App.css';
import { HashRouter as Router, Route, Link, Switch, withRouter } from 'react-router-dom';

import Login from './pages/login/index';
import Detail from './pages/detail/index';
import Profile from './pages/profile/index';
import Home from './pages/home/index';

function App() {
  return (
    <div className="App">
			<Router>
			
				<AuthRoute />
				
				<Switch>
					<Route path="/login" component={Login} />
					<Route path="/detail" component={Detail} />
					<Route path="/profile" component={Profile} />
					<Route path="/" component={Home} />
				</Switch>

			</Router>
    </div>
  );
}

class Auth extends Component {
	
	render(){
		return null;
	}
	
	
	componentDidMount(){
		var login = localStorage.getItem('login');
		
		console.log(login)
	}
}

const AuthRoute = withRouter(Auth);

export default App;
